﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FunctionForMean
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入十个数字,以空格分开：");
            string str = Console.ReadLine();
            string[] strnumber = str.Split(' ');
            int length = strnumber.Count();
            int[] number = new int[length];
            for (int i = 0; i < length; i++)
            {
                number[i] = Convert.ToInt32(strnumber[i]);
            }
            Console.WriteLine("这十个数的平均数为："+functionmean(number));
            Console.ReadKey();
        }
        static int functionmean(params int[] numbers)
        {
            int sum = 0;
            for (int i = 0; i < 10; i++)
            {
                sum += numbers[i];
            }
            int result = sum / 10;
            return result;
        }
    }
}
